using System;
using OracleInternal.Sharding;

namespace Oracle.ManagedDataAccess.Client
{
	public class OracleShardingKey : IDisposable
	{
		internal OracleShardingKeyImpl m_shardingKeyImpl;

		internal OracleShardingKeyImpl ShardingKeyInternal
		{
			get
			{
				return m_shardingKeyImpl;
			}
			set
			{
				m_shardingKeyImpl = value;
			}
		}

		internal bool IsSuperShardingKey
		{
			get
			{
				return m_shardingKeyImpl.IsSuperShardingKey;
			}
			set
			{
				m_shardingKeyImpl.IsSuperShardingKey = value;
			}
		}

		internal void Init()
		{
			m_shardingKeyImpl = new OracleShardingKeyImpl();
		}

		public OracleShardingKey()
		{
			Init();
		}

		public OracleShardingKey(OracleDbType oracleDbType, object data)
		{
			Init();
			m_shardingKeyImpl.SetShardingKey(oracleDbType, data);
		}

		public void SetShardingKey(OracleDbType oracleDbType, object data)
		{
			m_shardingKeyImpl.SetShardingKey(oracleDbType, data);
		}

		internal void Build()
		{
			m_shardingKeyImpl.Build();
		}

		internal string EncodeKeyinB64Format()
		{
			return m_shardingKeyImpl.EncodeKeyinB64Format();
		}

		public void Dispose()
		{
			GC.SuppressFinalize(this);
		}
	}
}
